<template>
  <view class="scan-page">
    <!-- 扫码框 -->
    <view class="scan-box">
      <view class="corner tl"></view>
      <view class="corner tr"></view>
      <view class="corner bl"></view>
      <view class="corner br"></view>
    </view>
  </view>
</template>

<script setup>
import { onMounted } from 'vue'
onMounted(() => {
  uni.scanCode({
    success: function (res) {
		// 这里可以解析res.result，带参数跳转
		uni.navigateTo({
			url: '/pages/C/home/pay-password' // 可根据res.result动态传参
		})
    },
    fail: function () {
		uni.navigateTo({
			url: '/pages/C/home/pay-fail' // 可根据res.result动态传参
		})
		uni.showToast({ title: '扫码取消', icon: 'none' })
    }
  })
})
</script>

<style scoped src="./scan.css"></style> 